import { APPFN_SET_VALUE_LABEL, APPFN_SET_VALUE_MAP } from '@/utils/tools';

// 任务进度
export enum taskTypeEnum {
  custom = 1, // 1：自定义任务
  intention = 2, // 2：意向申请
  initiation = 3, // 3：立项申请
  meetingAppointment = 4, // 4：启动会预约
  meetingHGeld = 5, // 立项申请
  conclusionApplication = 6, // 6：结题申请
  conclusionReview = 7, // 7：项目结题
  contract = 8, // 合同任务
}
export const TASK_TYPES = [
  {
    value: taskTypeEnum.custom,
    label: '自定义任务',
  },
  {
    value: taskTypeEnum.intention,
    label: '意向申请',
  },
  {
    value: taskTypeEnum.initiation,
    label: '立项申请',
  },
  {
    value: taskTypeEnum.meetingAppointment,
    label: '启动会预约',
  },
  {
    value: taskTypeEnum.meetingHGeld,
    label: '启动会召开',
  },
  {
    value: taskTypeEnum.conclusionApplication,
    label: '结题申请',
  },
  {
    value: taskTypeEnum.conclusionReview,
    label: '项目结题',
  },
];

export enum TaskStatusEnum {
  draft = 1, // 1：草稿
  pendingSubmission = 2, // 2：已发布
  pendingFeedback = 3, // 3：待反馈
  underApproval = 4, // 4：审批中
  returned = 5, // 5：已退回
  completed = 6, // 6：已完成
  over = 7, // 7：已中止
  waitingAccepted = 8, // 8：受理中
  rejected = 9, // 9：已拒绝
  signing = 11,
}

export const TASK_STATUS_TYPES = [
  {
    value: TaskStatusEnum.draft,
    label: '草稿',
    color: 'info',
  },
  {
    value: TaskStatusEnum.pendingSubmission,
    label: '已发布',
    color: 'primary',
  },
  {
    value: TaskStatusEnum.pendingFeedback,
    label: '待反馈',
    color: 'primary',
  },
  {
    value: TaskStatusEnum.underApproval,
    label: '审批中',
    color: 'warning',
  },
  {
    value: TaskStatusEnum.returned,
    label: '已退回',
    color: 'error',
  },
  {
    value: TaskStatusEnum.completed,
    label: '已完成',
    color: 'success',
  },
  {
    value: TaskStatusEnum.over,
    label: '已终止',
    color: 'info',
  },
  {
    value: TaskStatusEnum.waitingAccepted,
    label: '待受理',
    color: 'primary',
  },
  {
    value: TaskStatusEnum.rejected,
    label: '已拒绝',
    color: 'error',
  },
  {
    value: TaskStatusEnum.signing,
    label: '电子签署中',
    color: 'warning',
  },
];

// 审查状态枚举
//[3, 5, 6, 8, 9, 71, 87, 10, 91, 31, 32, 33, 34]
export enum CheckStatusEnum {
  // 待提交
  TO_BE_SUBMIT = -1,
  // 已删除
  DELETE = 0,
  //草稿
  DRAFT = 1,
  //待领取
  PENDING_RECEIVE = 10,
  //审查结束
  COMPLETE = 11,
  // 普通驳回
  ORDINARY_REJECT = 21,
  // 受理驳回
  SUBJECTS_REJECT = 22,
  // 形式审查驳回
  FORM_REJECT = 23,
  // 待安排会议驳回
  ARRANGE_MEETING_REJECT = 24,
  //待上会驳回
  TO_MEETING_REJECT = 25,
  //快速审查驳回
  QUICK_REVIEW_REJECT = 26,
  //待受理
  PENDING = 3,
  //待受理--其他角色
  PENDING_OTHER_ROLE = 31,
  //受理后其他角色审查的退回
  FROM_PENDING_OTHER_ROLE = 32,
  //形式审查后其他角色审核
  FORMAL_REVIEW_OTHER_ROLE = 33,
  //形式审查中(roleName退回)
  FROM_FORMAL_REVIEW_OTHER_ROLE = 34,
  //形式审查中
  FORMAL_REVIEW = 4,
  // 待安排会议
  PENDING_MEETING = 5,
  // 审核驳回
  AUTIT_REJECT = 58,
  //待上会
  WAITING_MEETING = 6,
  //会议审查中
  IN_MEETING = 71,
  // 快速审查中
  QUICK_REVIEW = 72,
  //紧急会议审查中
  IN_EMERGENCY_MEETING = 73,
  //待整理
  PENDING_ARRANGE = 8,
  //待审核
  AUDIT = 87,
  //整理中
  ARRANGE = 9,
  //批件审核中
  APPROVAL_REVIEW = 91,
  //批件电子签署中
  APPROVAL_SIGN = 92,
  //安排会议前待复审
  AUDIT_BEFORE_MEETING = 96,
}
export const CHECK_STATUS: any = {
  [CheckStatusEnum.TO_BE_SUBMIT]: {
    label: '待提交',
    color: 'primary',
  },
  [CheckStatusEnum.DELETE]: {
    label: '已删除',
    color: 'error',
  },
  [CheckStatusEnum.DRAFT]: {
    label: '草稿',
    color: 'info',
  },
  [CheckStatusEnum.PENDING_RECEIVE]: {
    label: '待领取',
    color: 'primary',
  },
  [CheckStatusEnum.COMPLETE]: {
    label: '审查结束',
    color: 'success',
  },
  [CheckStatusEnum.ORDINARY_REJECT]: {
    label: '普通驳回',
    color: 'warning',
  },
  [CheckStatusEnum.SUBJECTS_REJECT]: {
    label: '受理驳回',
    color: 'warning',
  },
  [CheckStatusEnum.FORM_REJECT]: {
    label: '形式审查驳回',
    color: 'warning',
  },
  [CheckStatusEnum.ARRANGE_MEETING_REJECT]: {
    label: '待安排会议驳回',
    color: 'warning',
  },
  [CheckStatusEnum.TO_MEETING_REJECT]: {
    label: '待上会驳回',
    color: 'warning',
  },
  [CheckStatusEnum.QUICK_REVIEW_REJECT]: {
    label: '快速审查驳回',
    color: 'warning',
  },
  [CheckStatusEnum.PENDING]: {
    label: '待受理',
    color: 'primary',
  },
  [CheckStatusEnum.PENDING_OTHER_ROLE]: {
    label: '待受理-其他角色',
    color: 'primary',
  },
  [CheckStatusEnum.FROM_PENDING_OTHER_ROLE]: {
    label: '受理后其他角色审查的退回',
    color: 'primary',
  },
  [CheckStatusEnum.FORMAL_REVIEW_OTHER_ROLE]: {
    label: '形式审查后其他角色审核',
    color: 'primary',
  },
  [CheckStatusEnum.FROM_FORMAL_REVIEW_OTHER_ROLE]: {
    label: '形式审查中(roleName退回)',
    color: 'primary',
  },
  [CheckStatusEnum.FORMAL_REVIEW]: {
    label: '形式审查中',
    color: 'primary',
  },
  [CheckStatusEnum.PENDING_MEETING]: {
    label: '待安排会议',
    color: 'primary',
  },
  [CheckStatusEnum.AUTIT_REJECT]: {
    label: '审核驳回',
    color: 'warning',
  },
  [CheckStatusEnum.WAITING_MEETING]: {
    label: '待上会',
    color: 'primary',
  },
  [CheckStatusEnum.IN_MEETING]: {
    label: '会议审查中',
    color: 'primary',
  },
  [CheckStatusEnum.QUICK_REVIEW]: {
    label: '快速审查中',
    color: 'primary',
  },
  [CheckStatusEnum.IN_EMERGENCY_MEETING]: {
    label: '紧急会议审查中',
    color: 'primary',
  },
  [CheckStatusEnum.PENDING_ARRANGE]: {
    label: '待整理',
    color: 'primary',
  },
  [CheckStatusEnum.AUDIT]: {
    label: '待审核',
    color: 'primary',
  },
  [CheckStatusEnum.ARRANGE]: {
    label: '整理中',
    color: 'primary',
  },
  [CheckStatusEnum.APPROVAL_REVIEW]: {
    label: '批件审核中',
    color: 'primary',
  },
  [CheckStatusEnum.APPROVAL_SIGN]: {
    label: '批件电子签署中',
    color: 'primary',
  },
  [CheckStatusEnum.AUDIT_BEFORE_MEETING]: {
    label: '安排会议前待复审',
    color: 'primary',
  },
};

export const TASKTYPES_MAP = APPFN_SET_VALUE_LABEL(TASK_TYPES);
export const TASK_STATUS_TYPES_MAP = APPFN_SET_VALUE_MAP(TASK_STATUS_TYPES);
